package cn.bonoon.entities;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import cn.bonoon.kernel.support.entities.AbstractPersistable;

/**
 * <pre>
 * 当服务器启动的时候就应该向数据库添加一条启动记录；
 * 
 * 这里可以显示当前正在运行的服务器(包括集群情况、多个服务器)；
 * 
 * 当服务器退出服务的时候就应该通过数据库已经退出
 * 
 * 服务器运行过程中，需要定时通知数据库，这样系统才能确保某一个服务器正在运行中
 * </pre>
 * 
 * @author jackson
 * 
 */
/**
 * @author Administrator
 * 
 */
@Entity
@Table(name = "t_server")
public class ServerEntity extends AbstractPersistable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -6464486622831664327L;

	@Column(name = "C_IPS", length = 500)
	private String ips;

	@Column(name = "C_KEY", length = 40)
	private String key;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "C_STARTAT", nullable = false)
	private Date startAt;

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "C_REFRESHAT")
	private Date refreshAt;

	/**
	 * 服务器的类型，如：应用服务器、连接器、mq服务器等类型
	 */
	@Column(name = "C_TYPE")
	private int type;

	/**
	 * 操作系统
	 */
	@Column(name = "C_OSINFO")
	private String osInfo;
	/**
	 * JDK
	 */
	@Column(name = "C_JVMINFO")
	private String jvmInfo;

	@Column(name = "C_SERVERINFO")
	private String serverInfo;
	/**
	 * CPU（型号+主频+带宽+其他）
	 */
	@Column(name = "C_CPUINFO")
	private String cpuInfo;
	/**
	 * 内存（型号+大小+其他）
	 */
	@Column(name = "C_MEMORYINFO")
	private String memoryInfo;
	/**
	 * 硬盘（型号+大小+其他）
	 */
	@Column(name = "C_HARDDISKINFO")
	private String hardDiskInfo;
	/**
	 * 其它硬件信息
	 */
	@Column(name = "C_OTHERHARDWAREINFO")
	private String otherHardwareInfo;
	/**
	 * 退出时间
	 */
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "C_EXITAT")
	private Date exitAt;

	public Date getStartAt() {
		return startAt;
	}

	public void setStartAt(Date startAt) {
		this.startAt = startAt;
	}

	public Date getRefreshAt() {
		return refreshAt;
	}

	public void setRefreshAt(Date refreshAt) {
		this.refreshAt = refreshAt;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	public String getIps() {
		return ips;
	}

	public void setIps(String ips) {
		this.ips = ips;
	}

	public String getKey() {
		return key;
	}

	public void setKey(String key) {
		this.key = key;
	}

	public Date getExitAt() {
		return exitAt;
	}

	public void setExitAt(Date exitAt) {
		this.exitAt = exitAt;
	}

	public String getCpuInfo() {
		return cpuInfo;
	}

	public void setCpuInfo(String cpuInfo) {
		this.cpuInfo = cpuInfo;
	}

	public String getMemoryInfo() {
		return memoryInfo;
	}

	public void setMemoryInfo(String memoryInfo) {
		this.memoryInfo = memoryInfo;
	}

	public String getHardDiskInfo() {
		return hardDiskInfo;
	}

	public void setHardDiskInfo(String hardDiskInfo) {
		this.hardDiskInfo = hardDiskInfo;
	}

	public String getOtherHardwareInfo() {
		return otherHardwareInfo;
	}

	public void setOtherHardwareInfo(String otherHardwareInfo) {
		this.otherHardwareInfo = otherHardwareInfo;
	}

	public String getJvmInfo() {
		return jvmInfo;
	}

	public void setJvmInfo(String jvmInfo) {
		this.jvmInfo = jvmInfo;
	}

	public String getOsInfo() {
		return osInfo;
	}

	public void setOsInfo(String osInfo) {
		this.osInfo = osInfo;
	}

	public String getServerInfo() {
		return serverInfo;
	}

	public void setServerInfo(String serverInfo) {
		this.serverInfo = serverInfo;
	}

}
